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

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

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

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

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

j = A("j")
l = B("l")
c = C("c")
g = D("g")
e = E("e")
h = E("h")
b = A("b")

j.u = g
j.v = l
l.z = g
l.q = g
l.w = h
c.o = g
c.v = g
c.s = l
g.t = c
e.v = h
e.z = g
e.o = g
h.v = e
h.z = g
h.o = g
b.u = g
b.v = l
assert b.v.z.t.s.z.t.s.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: B = None
        self.txt = txt

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

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

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

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

j = A("j")
l = B("l")
c = C("c")
g = D("g")
e = E("e")
h = E("h")
b = A("b")

j.u = g
j.v = l
l.z = g
l.q = g
l.w = h
c.o = g
c.v = g
c.s = l
g.t = c
e.v = h
e.z = g
e.o = g
h.v = e
h.z = g
h.o = g
b.u = g
b.v = l
assert b.v.z.t.s.z.t.s.txt == "l"