class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: E = None
        self.t: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: C = None
        self.t: C = None
        self.u: C = None
        self.txt = txt

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

m = A("m")
b = B("b")
g = C("g")
k = D("k")
h = E("h")
f = D("f")

m.s = h
m.o = h
m.t = b
b.t = h
g.o = h
k.x = g
k.v = g
k.t = g
k.u = g
h.p = m
f.x = g
f.v = g
f.t = g
f.u = g
assert g.o.p.t.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: E = None
        self.t: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: C = None
        self.t: C = None
        self.u: C = None
        self.txt = txt

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

m = A("m")
b = B("b")
g = C("g")
k = D("k")
h = E("h")
f = D("f")

m.s = h
m.o = h
m.t = b
b.t = h
g.o = h
k.x = g
k.v = g
k.t = g
k.u = g
h.p = m
f.x = g
f.v = g
f.t = g
f.u = g
assert g.o.p.t.txt == "b"