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

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: C = None
        self.o: C = None
        self.v: C = None
        self.w: C = None
        self.txt = txt

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

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

f = A("f")
e = B("e")
j = C("j")
b = D("b")
i = E("i")
h = F("h")

f.w = j
f.v = i
e.o = b
e.y = b
e.z = i
e.q = f
e.t = j
j.q = e
j.w = e
b.x = i
b.r = j
b.o = j
b.v = j
b.w = j
i.y = h
h.u = j
assert e.z.y.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: C = None
        self.o: C = None
        self.v: C = None
        self.w: C = None
        self.txt = txt

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

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

f = A("f")
e = B("e")
j = C("j")
b = D("b")
i = E("i")
h = F("h")

f.w = j
f.v = i
e.o = b
e.y = b
e.z = i
e.q = f
e.t = j
j.q = e
j.w = e
b.x = i
b.r = j
b.o = j
b.v = j
b.w = j
i.y = h
h.u = j
assert e.z.y.u.txt == "j"