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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: A = None
        self.p: A = None
        self.u: B = None
        self.v: E = None
        self.txt = txt

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

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

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

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

j.u = i
j.v = i
j.t = e
h.q = j
h.s = j
h.p = j
h.u = k
h.v = e
i.r = e
c.r = j
e.y = i
g.y = i
l.q = j
l.s = j
l.p = j
l.u = h
l.v = g
b.r = j
k.q = j
k.s = j
k.p = j
k.u = h
k.v = e
assert h.v.y.r.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: E = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: A = None
        self.p: A = None
        self.u: B = None
        self.v: E = None
        self.txt = txt

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

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

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

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

j.u = i
j.v = i
j.t = e
h.q = j
h.s = j
h.p = j
h.u = k
h.v = e
i.r = e
c.r = j
e.y = i
g.y = i
l.q = j
l.s = j
l.p = j
l.u = h
l.v = g
b.r = j
k.q = j
k.s = j
k.p = j
k.u = h
k.v = e
assert h.v.y.r.txt == "e"