class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: D = None
        self.v: F = None
        self.u: D = None
        self.y: C = None
        self.q: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: E = None
        self.txt = txt

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

j = A("j")
i = B("i")
c = C("c")
f = D("f")
e = E("e")
n = F("n")
d = E("d")

j.o = f
j.x = f
j.u = f
j.q = f
j.v = n
j.y = c
i.r = j
i.x = j
i.t = c
i.q = d
i.v = n
c.z = n
f.v = i
e.o = j
e.x = d
n.u = j
n.w = i
n.y = e
n.z = d
n.r = f
n.x = f
d.o = j
d.x = e
assert d.x.x.o.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: D = None
        self.v: F = None
        self.u: D = None
        self.y: C = None
        self.q: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: E = None
        self.txt = txt

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

j = A("j")
i = B("i")
c = C("c")
f = D("f")
e = E("e")
n = F("n")
d = E("d")

j.o = f
j.x = f
j.u = f
j.q = f
j.v = n
j.y = c
i.r = j
i.x = j
i.t = c
i.q = d
i.v = n
c.z = n
f.v = i
e.o = j
e.x = d
n.u = j
n.w = i
n.y = e
n.z = d
n.r = f
n.x = f
d.o = j
d.x = e
assert d.x.x.o.v.u.txt == "j"