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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: B = None
        self.r: A = None
        self.w: E = None
        self.z: E = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: B = None
        self.r: A = None
        self.w: E = None
        self.z: E = None
        self.txt = txt

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

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

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

n.x = a
n.w = b
n.u = g
l.x = a
l.o = a
l.s = n
a.s = l
a.v = l
a.r = n
a.w = g
a.z = g
c.o = n
c.x = a
b.t = g
g.t = b
h.o = n
h.x = a
assert c.x.w.t.t.txt == "g"