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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: E = None
        self.x: D = None
        self.w: F = None
        self.z: F = None
        self.s: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: C = None
        self.q: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: E = None
        self.x: D = None
        self.w: F = None
        self.z: F = None
        self.s: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: C = None
        self.q: C = None
        self.txt = txt

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

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

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