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

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

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

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

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

g = A("g")
e = B("e")
f = C("f")
a = D("a")
b = E("b")
h = B("h")
m = E("m")
n = A("n")
k = D("k")

g.x = f
g.t = n
e.x = g
e.v = g
e.q = m
e.w = h
e.y = n
f.v = e
f.o = g
a.s = m
a.z = m
a.o = m
a.x = k
a.p = g
b.z = f
h.x = n
h.y = n
h.v = g
h.q = b
h.w = e
m.z = f
n.x = f
n.t = g
k.s = b
k.o = b
k.x = a
k.z = m
k.p = n
assert f.v.q.z.o.x.o.x.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: A = None
        self.txt = txt

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

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

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

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

g = A("g")
e = B("e")
f = C("f")
a = D("a")
b = E("b")
h = B("h")
m = E("m")
n = A("n")
k = D("k")

g.x = f
g.t = n
e.x = g
e.v = g
e.q = m
e.w = h
e.y = n
f.v = e
f.o = g
a.s = m
a.z = m
a.o = m
a.x = k
a.p = g
b.z = f
h.x = n
h.y = n
h.v = g
h.q = b
h.w = e
m.z = f
n.x = f
n.t = g
k.s = b
k.o = b
k.x = a
k.z = m
k.p = n
assert f.v.q.z.o.x.o.x.v.w.txt == "h"