class A:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: D = None
        self.y: E = None
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: H = None
        self.w: H = None
        self.p: E = None
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: B = None
        self.w: F = None
        self.v: E = None
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

g = A("g")
d = B("d")
k = C("k")
f = D("f")
i = E("i")
j = F("j")
c = G("c")
n = H("n")
m = A("m")
b = F("b")

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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: H = None
        self.w: H = None
        self.p: E = None
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: B = None
        self.w: F = None
        self.v: E = None
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

g = A("g")
d = B("d")
k = C("k")
f = D("f")
i = E("i")
j = F("j")
c = G("c")
n = H("n")
m = A("m")
b = F("b")

g.x = n
g.r = f
g.z = f
g.y = i
d.o = f
d.u = n
d.w = n
d.p = i
d.z = j
k.o = i
k.v = i
k.x = i
k.p = d
k.w = j
f.p = n
i.z = n
i.s = k
j.z = n
c.x = d
c.r = i
c.p = f
c.t = f
c.y = k
c.o = k
n.o = j
m.x = n
m.r = f
m.z = f
m.y = i
b.z = n
assert n.o.z.o.z.o.z.o.z.o.txt == "j"