class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: D = None
        self.z: C = None
        self.u: D = None
        self.q: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: A = None
        self.r: E = None
        self.x: F = None
        self.p: F = None
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: D = None
        self.q: C = None
        self.z: A = None
        self.u: C = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: C = None
        self.r: A = None
        self.s: C = None
        self.y: A = None
        self.z: E = None
        self.txt = txt

m = A("m")
f = B("f")
n = C("n")
h = D("h")
i = E("i")
d = F("d")
b = D("b")
e = A("e")

m.y = f
m.q = f
m.r = b
m.z = n
m.u = h
f.t = h
f.o = m
f.z = m
f.r = i
f.x = d
f.p = d
n.z = e
n.t = d
h.r = e
h.z = e
h.y = b
h.q = n
h.u = n
h.p = n
i.q = b
d.w = n
d.x = n
d.s = n
d.r = e
d.y = m
d.z = i
b.r = m
b.z = m
b.y = h
b.q = n
b.u = n
b.p = n
e.y = f
e.q = f
e.r = b
e.u = b
e.z = n
assert h.z.u.y.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: D = None
        self.z: C = None
        self.u: D = None
        self.q: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: A = None
        self.r: E = None
        self.x: F = None
        self.p: F = None
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: D = None
        self.q: C = None
        self.z: A = None
        self.u: C = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: C = None
        self.r: A = None
        self.s: C = None
        self.y: A = None
        self.z: E = None
        self.txt = txt

m = A("m")
f = B("f")
n = C("n")
h = D("h")
i = E("i")
d = F("d")
b = D("b")
e = A("e")

m.y = f
m.q = f
m.r = b
m.z = n
m.u = h
f.t = h
f.o = m
f.z = m
f.r = i
f.x = d
f.p = d
n.z = e
n.t = d
h.r = e
h.z = e
h.y = b
h.q = n
h.u = n
h.p = n
i.q = b
d.w = n
d.x = n
d.s = n
d.r = e
d.y = m
d.z = i
b.r = m
b.z = m
b.y = h
b.q = n
b.u = n
b.p = n
e.y = f
e.q = f
e.r = b
e.u = b
e.z = n
assert h.z.u.y.u.t.txt == "d"