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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: F = None
        self.y: A = None
        self.s: F = None
        self.t: F = None
        self.x: A = None
        self.txt = txt

k = A("k")
g = B("g")
b = C("b")
e = D("e")
f = E("f")
m = F("m")
h = D("h")
l = F("l")
a = D("a")

k.r = b
g.v = k
b.z = g
b.u = f
b.y = f
b.x = l
b.w = l
e.x = m
f.x = a
f.z = b
f.t = l
m.v = g
m.p = l
m.s = l
m.t = l
m.y = k
m.x = k
h.x = l
l.v = g
l.p = m
l.s = m
l.t = m
l.y = k
l.x = k
a.x = l
assert f.t.v.v.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: F = None
        self.y: A = None
        self.s: F = None
        self.t: F = None
        self.x: A = None
        self.txt = txt

k = A("k")
g = B("g")
b = C("b")
e = D("e")
f = E("f")
m = F("m")
h = D("h")
l = F("l")
a = D("a")

k.r = b
g.v = k
b.z = g
b.u = f
b.y = f
b.x = l
b.w = l
e.x = m
f.x = a
f.z = b
f.t = l
m.v = g
m.p = l
m.s = l
m.t = l
m.y = k
m.x = k
h.x = l
l.v = g
l.p = m
l.s = m
l.t = m
l.y = k
l.x = k
a.x = l
assert f.t.v.v.r.txt == "b"