class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: C = None
        self.q: D = None
        self.t: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: F = None
        self.o: F = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: G = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: C = None
        self.x: C = None
        self.o: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: F = None
        self.o: F = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: G = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: C = None
        self.x: C = None
        self.o: B = None
        self.txt = txt

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

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