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

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

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

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

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

j = A("j")
m = B("m")
k = C("k")
l = D("l")
g = E("g")
e = D("e")

j.y = k
j.o = k
j.v = g
m.p = e
m.v = k
m.t = k
k.u = m
l.x = j
l.u = j
g.t = e
e.x = j
e.u = j
assert g.t.x.o.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: C = None
        self.v: E = None
        self.txt = txt

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

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

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

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

j = A("j")
m = B("m")
k = C("k")
l = D("l")
g = E("g")
e = D("e")

j.y = k
j.o = k
j.v = g
m.p = e
m.v = k
m.t = k
k.u = m
l.x = j
l.u = j
g.t = e
e.x = j
e.u = j
assert g.t.x.o.txt == "k"