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

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: E = None
        self.x: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: D = None
        self.o: B = None
        self.txt = txt

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

m = A("m")
i = B("i")
j = C("j")
e = D("e")
g = E("g")
f = F("f")

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

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: E = None
        self.x: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: D = None
        self.o: B = None
        self.txt = txt

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

m = A("m")
i = B("i")
j = C("j")
e = D("e")
g = E("g")
f = F("f")

m.s = i
m.p = f
m.x = f
i.u = m
j.u = g
j.s = g
j.x = f
e.u = f
e.z = f
e.v = j
e.q = m
e.p = g
g.z = e
g.y = e
g.o = i
f.y = e
f.o = e
f.x = e
f.t = i
f.s = i
f.r = g
assert i.u.x.s.u.p.txt == "f"