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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: C = None
        self.x: C = None
        self.s: B = None
        self.t: A = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: C = None
        self.x: C = None
        self.s: B = None
        self.t: A = None
        self.txt = txt

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

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

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