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

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

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

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

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

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

e.u = j
e.v = m
e.z = m
e.o = n
k.v = j
k.x = j
k.w = g
k.u = g
j.t = g
j.z = g
n.w = g
g.o = m
g.r = j
g.q = n
m.u = j
m.v = e
m.z = e
m.o = n
assert e.u.z.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: A = None
        self.z: A = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

e.u = j
e.v = m
e.z = m
e.o = n
k.v = j
k.x = j
k.w = g
k.u = g
j.t = g
j.z = g
n.w = g
g.o = m
g.r = j
g.q = n
m.u = j
m.v = e
m.z = e
m.o = n
assert e.u.z.o.u.txt == "j"