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

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

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

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

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

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

c = A("c")
a = B("a")
m = C("m")
b = D("b")
k = E("k")
n = F("n")
g = C("g")

c.t = a
c.s = m
a.o = c
m.o = g
m.t = k
m.v = b
m.y = n
b.q = n
k.y = g
k.r = g
k.u = c
n.u = b
g.o = m
g.t = k
g.v = b
g.y = n
assert g.o.y.u.q.u.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: C = None
        self.txt = txt

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

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

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

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

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

c = A("c")
a = B("a")
m = C("m")
b = D("b")
k = E("k")
n = F("n")
g = C("g")

c.t = a
c.s = m
a.o = c
m.o = g
m.t = k
m.v = b
m.y = n
b.q = n
k.y = g
k.r = g
k.u = c
n.u = b
g.o = m
g.t = k
g.v = b
g.y = n
assert g.o.y.u.q.u.q.u.txt == "b"