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

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

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

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

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

f = A("f")
a = B("a")
n = C("n")
c = D("c")
k = E("k")
j = C("j")

f.o = k
f.u = c
a.q = k
a.v = f
a.y = f
a.z = c
n.s = c
n.z = k
n.t = k
n.p = k
n.o = k
c.t = k
c.o = k
c.p = n
c.w = f
c.r = f
k.v = a
j.s = c
j.z = k
j.t = k
j.p = k
j.o = k
assert j.s.w.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: D = None
        self.txt = txt

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

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

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

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

f = A("f")
a = B("a")
n = C("n")
c = D("c")
k = E("k")
j = C("j")

f.o = k
f.u = c
a.q = k
a.v = f
a.y = f
a.z = c
n.s = c
n.z = k
n.t = k
n.p = k
n.o = k
c.t = k
c.o = k
c.p = n
c.w = f
c.r = f
k.v = a
j.s = c
j.z = k
j.t = k
j.p = k
j.o = k
assert j.s.w.o.v.txt == "a"