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

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

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

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

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

h = A("h")
c = B("c")
g = C("g")
f = D("f")
l = E("l")
j = A("j")
d = D("d")
e = B("e")
n = E("n")

h.t = f
h.r = n
c.u = g
c.r = d
c.v = l
c.z = f
c.x = h
g.u = d
g.q = d
f.o = j
l.q = e
j.t = d
j.r = l
d.o = j
e.u = g
e.r = f
e.z = f
e.v = n
e.x = j
n.q = c
assert l.q.v.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: E = None
        self.txt = txt

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

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

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

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

h = A("h")
c = B("c")
g = C("g")
f = D("f")
l = E("l")
j = A("j")
d = D("d")
e = B("e")
n = E("n")

h.t = f
h.r = n
c.u = g
c.r = d
c.v = l
c.z = f
c.x = h
g.u = d
g.q = d
f.o = j
l.q = e
j.t = d
j.r = l
d.o = j
e.u = g
e.r = f
e.z = f
e.v = n
e.x = j
n.q = c
assert l.q.v.q.txt == "c"