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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: C = None
        self.y: E = None
        self.o: E = None
        self.t: A = None
        self.x: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

b = A("b")
m = B("m")
c = C("c")
e = D("e")
k = E("k")
d = F("d")
h = C("h")
l = B("l")

b.w = e
b.q = e
b.t = e
b.o = k
b.z = l
m.p = d
c.q = e
c.w = l
e.v = b
e.t = b
e.x = b
e.r = h
e.y = k
e.o = k
k.w = d
k.v = d
k.s = h
k.z = m
d.s = e
h.q = e
h.w = m
l.p = d
assert m.p.s.o.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: E = None
        self.z: B = None
        self.q: D = None
        self.t: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: C = None
        self.y: E = None
        self.o: E = None
        self.t: A = None
        self.x: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

b = A("b")
m = B("m")
c = C("c")
e = D("e")
k = E("k")
d = F("d")
h = C("h")
l = B("l")

b.w = e
b.q = e
b.t = e
b.o = k
b.z = l
m.p = d
c.q = e
c.w = l
e.v = b
e.t = b
e.x = b
e.r = h
e.y = k
e.o = k
k.w = d
k.v = d
k.s = h
k.z = m
d.s = e
h.q = e
h.w = m
l.p = d
assert m.p.s.o.txt == "k"