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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: E = None
        self.u: B = None
        self.v: C = None
        self.txt = txt

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

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

e.u = l
f.q = h
f.s = n
f.w = e
h.x = i
i.t = c
i.o = c
i.w = e
i.p = e
i.x = f
n.q = f
n.u = f
n.w = b
n.v = h
c.z = l
c.w = i
c.v = i
l.q = f
l.u = f
l.w = n
l.v = h
b.q = f
b.u = f
b.w = l
b.v = h
assert c.z.q.q.x.p.u.w.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: E = None
        self.u: B = None
        self.v: C = None
        self.txt = txt

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

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

e.u = l
f.q = h
f.s = n
f.w = e
h.x = i
i.t = c
i.o = c
i.w = e
i.p = e
i.x = f
n.q = f
n.u = f
n.w = b
n.v = h
c.z = l
c.w = i
c.v = i
l.q = f
l.u = f
l.w = n
l.v = h
b.q = f
b.u = f
b.w = l
b.v = h
assert c.z.q.q.x.p.u.w.txt == "n"