class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: F = None
        self.w: F = None
        self.o: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: A = None
        self.q: A = None
        self.t: A = None
        self.s: C = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: F = None
        self.s: E = None
        self.q: F = None
        self.u: A = None
        self.txt = txt

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

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

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

h = A("h")
c = B("c")
e = C("e")
m = D("m")
b = E("b")
f = F("f")

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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: A = None
        self.q: A = None
        self.t: A = None
        self.s: C = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: F = None
        self.s: E = None
        self.q: F = None
        self.u: A = None
        self.txt = txt

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

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

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

h = A("h")
c = B("c")
e = C("e")
m = D("m")
b = E("b")
f = F("f")

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