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

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

class C:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: B = None
        self.y: B = None
        self.s: C = None
        self.txt = txt

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

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

c = A("c")
e = B("e")
d = C("d")
f = D("f")
g = E("g")
h = A("h")
n = A("n")
k = B("k")
j = C("j")
b = E("b")

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

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

class C:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: B = None
        self.y: B = None
        self.s: C = None
        self.txt = txt

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

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

c = A("c")
e = B("e")
d = C("d")
f = D("f")
g = E("g")
h = A("h")
n = A("n")
k = B("k")
j = C("j")
b = E("b")

c.q = k
c.u = n
c.v = j
e.o = j
e.t = f
e.s = n
d.z = j
d.s = j
d.v = k
d.y = k
f.p = k
f.q = k
f.s = h
f.x = h
f.z = e
g.y = b
g.w = f
g.s = e
h.q = e
h.u = n
h.v = j
n.q = k
n.u = c
n.v = d
k.o = d
k.t = f
k.s = h
j.z = d
j.s = d
j.v = k
j.y = k
b.y = g
b.w = f
b.s = e
assert k.t.s.q.t.p.txt == "k"