class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: D = None
        self.z: B = None
        self.o: D = None
        self.p: B = None
        self.q: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: F = None
        self.w: B = None
        self.txt = txt

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

e = A("e")
n = B("n")
k = C("k")
a = D("a")
m = E("m")
b = F("b")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: F = None
        self.w: B = None
        self.txt = txt

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

e = A("e")
n = B("n")
k = C("k")
a = D("a")
m = E("m")
b = F("b")

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