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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: A = None
        self.x: E = None
        self.q: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: B = None
        self.txt = txt

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

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

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

f.r = k
f.v = b
c.o = j
c.q = d
c.v = d
c.z = b
c.p = b
c.t = l
j.s = l
j.w = f
j.q = f
j.x = d
l.r = k
l.z = c
d.s = l
d.t = j
b.q = j
b.r = l
k.s = l
k.t = j
assert c.o.q.v.q.x.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: A = None
        self.x: E = None
        self.q: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: B = None
        self.txt = txt

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

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

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

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