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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: F = None
        self.p: B = None
        self.y: A = None
        self.t: E = None
        self.txt = txt

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

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

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

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

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

l.p = h
n.q = a
n.u = i
n.p = d
n.y = l
n.t = h
c.z = l
c.w = b
m.q = l
h.w = n
h.y = i
h.o = l
a.w = d
b.z = l
b.w = c
e.q = l
i.w = n
d.q = a
d.u = i
d.p = n
d.y = l
d.t = h
assert e.q.p.o.p.y.w.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: F = None
        self.p: B = None
        self.y: A = None
        self.t: E = None
        self.txt = txt

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

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

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

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

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

l.p = h
n.q = a
n.u = i
n.p = d
n.y = l
n.t = h
c.z = l
c.w = b
m.q = l
h.w = n
h.y = i
h.o = l
a.w = d
b.z = l
b.w = c
e.q = l
i.w = n
d.q = a
d.u = i
d.p = n
d.y = l
d.t = h
assert e.q.p.o.p.y.w.txt == "n"