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

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

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

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

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

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

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

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

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

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

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

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

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

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

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