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

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

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

m = A("m")
n = B("n")
k = C("k")
e = D("e")
d = E("d")
i = F("i")

m.q = n
m.r = i
m.y = d
n.v = k
n.z = m
n.q = m
n.w = d
n.o = i
k.t = n
k.x = n
k.w = e
k.s = d
e.u = d
d.v = m
d.z = m
d.t = m
d.p = i
d.s = i
d.o = e
i.u = m
assert d.p.u.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: F = None
        self.y: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

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

m = A("m")
n = B("n")
k = C("k")
e = D("e")
d = E("d")
i = F("i")

m.q = n
m.r = i
m.y = d
n.v = k
n.z = m
n.q = m
n.w = d
n.o = i
k.t = n
k.x = n
k.w = e
k.s = d
e.u = d
d.v = m
d.z = m
d.t = m
d.p = i
d.s = i
d.o = e
i.u = m
assert d.p.u.r.u.txt == "m"