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

class B:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: G = None
        self.p: G = None
        self.y: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: G = None
        self.y: A = None
        self.q: G = None
        self.v: E = None
        self.w: G = None
        self.r: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: D = None
        self.t: F = None
        self.y: E = None
        self.w: F = None
        self.s: G = None
        self.u: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: G = None
        self.p: G = None
        self.y: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: G = None
        self.y: A = None
        self.q: G = None
        self.v: E = None
        self.w: G = None
        self.r: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: D = None
        self.t: F = None
        self.y: E = None
        self.w: F = None
        self.s: G = None
        self.u: E = None
        self.txt = txt

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

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