class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: B = None
        self.w: D = None
        self.p: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: D = None
        self.t: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: A = None
        self.x: C = None
        self.t: E = None
        self.txt = txt

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

g = A("g")
m = B("m")
d = C("d")
f = D("f")
n = E("n")
h = E("h")
e = D("e")

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

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: D = None
        self.t: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: A = None
        self.x: C = None
        self.t: E = None
        self.txt = txt

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

g = A("g")
m = B("m")
d = C("d")
f = D("f")
n = E("n")
h = E("h")
e = D("e")

g.u = n
g.t = m
g.p = m
g.w = e
m.v = h
m.o = h
m.x = n
d.r = e
d.t = e
d.y = f
f.s = e
f.p = g
f.x = d
f.t = n
n.t = m
n.u = g
h.t = m
h.u = g
e.s = f
e.p = g
e.x = d
e.t = n
assert g.u.t.x.txt == "n"