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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: B = None
        self.p: F = None
        self.o: F = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: F = None
        self.y: B = None
        self.w: A = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.w: A = None
        self.t: B = None
        self.v: C = None
        self.z: E = None
        self.txt = txt

h = A("h")
g = B("g")
l = C("l")
c = D("c")
j = E("j")
e = F("e")
b = E("b")

h.w = c
h.r = c
h.o = l
h.t = l
h.q = e
h.u = e
g.z = b
g.p = h
g.o = h
l.r = h
l.q = g
l.p = e
l.o = e
l.y = e
c.r = g
c.y = g
c.z = e
c.w = h
c.p = h
j.p = h
e.p = b
e.w = h
e.t = g
e.v = l
e.z = j
b.p = h
assert g.z.p.r.z.p.p.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: C = None
        self.r: D = None
        self.q: F = None
        self.t: C = None
        self.u: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: B = None
        self.p: F = None
        self.o: F = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: F = None
        self.y: B = None
        self.w: A = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.w: A = None
        self.t: B = None
        self.v: C = None
        self.z: E = None
        self.txt = txt

h = A("h")
g = B("g")
l = C("l")
c = D("c")
j = E("j")
e = F("e")
b = E("b")

h.w = c
h.r = c
h.o = l
h.t = l
h.q = e
h.u = e
g.z = b
g.p = h
g.o = h
l.r = h
l.q = g
l.p = e
l.o = e
l.y = e
c.r = g
c.y = g
c.z = e
c.w = h
c.p = h
j.p = h
e.p = b
e.w = h
e.t = g
e.v = l
e.z = j
b.p = h
assert g.z.p.r.z.p.p.txt == "h"