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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: A = None
        self.w: D = None
        self.z: F = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: A = None
        self.w: D = None
        self.z: F = None
        self.r: F = None
        self.txt = txt

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

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

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