class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.p: D = None
        self.u: B = None
        self.x: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: C = None
        self.s: F = None
        self.t: B = None
        self.z: B = None
        self.txt = txt

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

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

m = A("m")
n = B("n")
d = C("d")
k = D("k")
f = E("f")
a = F("a")

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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: C = None
        self.s: F = None
        self.t: B = None
        self.z: B = None
        self.txt = txt

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

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

m = A("m")
n = B("n")
d = C("d")
k = D("k")
f = E("f")
a = F("a")

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