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

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

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

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

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

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

l = A("l")
d = B("d")
g = C("g")
m = D("m")
c = E("c")
a = F("a")

l.q = g
l.y = d
l.s = m
d.r = m
d.s = m
d.q = m
d.x = c
d.p = c
d.v = a
g.o = d
g.u = d
g.q = c
m.t = a
m.y = c
c.t = a
c.s = a
c.r = l
c.o = g
a.t = l
a.u = m
a.o = c
assert a.u.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: B = None
        self.s: D = None
        self.txt = txt

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

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

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

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

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

l = A("l")
d = B("d")
g = C("g")
m = D("m")
c = E("c")
a = F("a")

l.q = g
l.y = d
l.s = m
d.r = m
d.s = m
d.q = m
d.x = c
d.p = c
d.v = a
g.o = d
g.u = d
g.q = c
m.t = a
m.y = c
c.t = a
c.s = a
c.r = l
c.o = g
a.t = l
a.u = m
a.o = c
assert a.u.t.t.txt == "l"