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

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: C = None
        self.y: B = None
        self.o: B = None
        self.txt = txt

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

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

n = A("n")
g = B("g")
c = C("c")
h = D("h")
l = E("l")
d = C("d")
k = A("k")
b = B("b")

n.t = d
n.s = l
g.z = h
c.t = k
c.x = d
c.y = b
c.o = b
h.u = k
h.x = l
l.s = k
d.t = k
d.x = c
d.y = b
d.o = g
k.t = d
k.s = l
b.z = h
assert d.o.z.x.s.t.x.x.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: C = None
        self.y: B = None
        self.o: B = None
        self.txt = txt

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

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

n = A("n")
g = B("g")
c = C("c")
h = D("h")
l = E("l")
d = C("d")
k = A("k")
b = B("b")

n.t = d
n.s = l
g.z = h
c.t = k
c.x = d
c.y = b
c.o = b
h.u = k
h.x = l
l.s = k
d.t = k
d.x = c
d.y = b
d.o = g
k.t = d
k.s = l
b.z = h
assert d.o.z.x.s.t.x.x.o.txt == "g"