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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: B = None
        self.z: E = None
        self.txt = txt

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

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

n = A("n")
g = B("g")
j = C("j")
m = D("m")
h = E("h")
f = A("f")
c = A("c")
i = C("i")
b = D("b")

n.x = h
n.o = c
n.t = m
g.s = h
g.y = f
g.p = b
j.p = h
j.z = h
j.s = g
m.t = h
h.t = m
h.x = g
h.v = n
f.x = h
f.o = c
f.t = b
c.x = h
c.o = f
c.t = b
i.p = h
i.z = h
i.s = g
b.t = h
assert n.x.v.t.t.v.x.x.y.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: A = None
        self.t: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: B = None
        self.z: E = None
        self.txt = txt

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

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

n = A("n")
g = B("g")
j = C("j")
m = D("m")
h = E("h")
f = A("f")
c = A("c")
i = C("i")
b = D("b")

n.x = h
n.o = c
n.t = m
g.s = h
g.y = f
g.p = b
j.p = h
j.z = h
j.s = g
m.t = h
h.t = m
h.x = g
h.v = n
f.x = h
f.o = c
f.t = b
c.x = h
c.o = f
c.t = b
i.p = h
i.z = h
i.s = g
b.t = h
assert n.x.v.t.t.v.x.x.y.x.txt == "h"