class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: F = None
        self.z: C = None
        self.x: B = None
        self.q: F = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.r: B = None
        self.q: F = None
        self.t: C = None
        self.y: C = None
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: A = None
        self.txt = txt

m = A("m")
a = B("a")
g = C("g")
h = D("h")
f = E("f")
j = F("j")
n = C("n")
i = B("i")
k = E("k")
b = A("b")

m.u = b
m.o = j
m.q = j
m.z = n
m.w = n
m.x = i
a.z = i
a.r = m
g.r = n
h.u = k
h.r = i
h.q = j
h.t = n
h.y = g
h.w = a
f.t = j
f.y = k
j.w = a
j.u = m
n.r = g
i.z = a
i.r = m
k.t = j
k.y = f
b.u = m
b.o = j
b.q = j
b.z = n
b.w = n
b.x = a
assert n.r.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: F = None
        self.z: C = None
        self.x: B = None
        self.q: F = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.r: B = None
        self.q: F = None
        self.t: C = None
        self.y: C = None
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: A = None
        self.txt = txt

m = A("m")
a = B("a")
g = C("g")
h = D("h")
f = E("f")
j = F("j")
n = C("n")
i = B("i")
k = E("k")
b = A("b")

m.u = b
m.o = j
m.q = j
m.z = n
m.w = n
m.x = i
a.z = i
a.r = m
g.r = n
h.u = k
h.r = i
h.q = j
h.t = n
h.y = g
h.w = a
f.t = j
f.y = k
j.w = a
j.u = m
n.r = g
i.z = a
i.r = m
k.t = j
k.y = f
b.u = m
b.o = j
b.q = j
b.z = n
b.w = n
b.x = a
assert n.r.r.r.txt == "g"