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

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

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

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

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

j = A("j")
f = B("f")
b = C("b")
h = D("h")
a = E("a")
m = E("m")
n = B("n")
d = C("d")

j.y = b
j.q = f
j.z = a
f.t = h
f.x = j
b.p = h
b.r = d
b.x = n
b.t = m
b.o = j
h.y = f
h.u = j
h.v = n
h.t = b
h.x = b
a.s = h
a.z = h
a.v = m
m.s = h
m.z = h
m.v = a
n.t = h
n.x = j
d.p = h
d.r = b
d.x = n
d.t = a
d.o = j
assert f.x.q.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: B = None
        self.z: E = None
        self.txt = txt

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

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

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

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

j = A("j")
f = B("f")
b = C("b")
h = D("h")
a = E("a")
m = E("m")
n = B("n")
d = C("d")

j.y = b
j.q = f
j.z = a
f.t = h
f.x = j
b.p = h
b.r = d
b.x = n
b.t = m
b.o = j
h.y = f
h.u = j
h.v = n
h.t = b
h.x = b
a.s = h
a.z = h
a.v = m
m.s = h
m.z = h
m.v = a
n.t = h
n.x = j
d.p = h
d.r = b
d.x = n
d.t = a
d.o = j
assert f.x.q.t.u.txt == "j"