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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: A = None
        self.r: C = None
        self.q: D = None
        self.z: D = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: A = None
        self.r: C = None
        self.q: D = None
        self.z: D = None
        self.txt = txt

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

b.z = j
b.q = j
b.v = j
b.s = j
b.t = l
h.r = f
l.q = f
j.x = l
j.r = l
j.q = f
j.w = k
j.z = k
k.s = h
k.p = f
k.y = j
f.o = h
f.s = b
f.r = l
f.q = j
f.z = j
assert f.r.q.o.r.r.txt == "l"