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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: B = None
        self.txt = txt

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

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

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

b = A("b")
j = B("j")
m = C("m")
i = D("i")
h = E("h")
l = F("l")
k = C("k")
f = E("f")
c = D("c")

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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: B = None
        self.txt = txt

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

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

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

b = A("b")
j = B("j")
m = C("m")
i = D("i")
h = E("h")
l = F("l")
k = C("k")
f = E("f")
c = D("c")

b.y = i
j.z = b
j.v = b
j.t = f
j.r = m
j.x = l
m.u = i
m.x = j
i.t = b
h.s = b
h.v = b
l.s = b
l.t = b
l.w = j
l.u = j
l.p = h
l.x = k
k.u = i
k.x = j
f.s = b
f.v = b
c.t = b
assert i.t.y.t.txt == "b"