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

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

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

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

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

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

m = A("m")
d = B("d")
k = C("k")
b = D("b")
i = E("i")
a = F("a")

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

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

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

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

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

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

m = A("m")
d = B("d")
k = C("k")
b = D("b")
i = E("i")
a = F("a")

m.v = d
m.r = d
m.u = a
m.w = a
d.p = b
d.q = k
d.o = k
d.t = k
d.v = m
k.v = i
k.o = i
k.t = d
k.w = d
k.p = d
b.r = i
i.q = a
i.r = a
i.w = a
i.z = m
i.v = k
i.p = d
a.t = m
a.o = i
a.x = i
a.z = i
a.q = d
assert m.v.p.r.q.txt == "a"