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

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

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

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

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

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

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

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

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

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

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

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

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

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

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