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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: F = None
        self.s: C = None
        self.r: F = None
        self.p: F = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: F = None
        self.s: C = None
        self.r: F = None
        self.p: F = None
        self.txt = txt

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

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

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

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

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

k.t = d
d.v = c
d.w = m
d.r = m
d.p = m
d.s = g
c.w = k
c.q = g
c.x = g
c.v = b
b.r = d
b.u = d
b.q = m
a.p = n
a.t = k
a.z = k
a.w = d
a.s = d
m.v = d
m.z = n
m.t = a
m.y = b
n.t = d
g.w = n
g.q = c
g.x = c
g.v = b
assert c.x.v.u.txt == "d"