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

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

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: E = None
        self.r: B = None
        self.q: B = None
        self.txt = txt

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

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

k = A("k")
i = B("i")
h = C("h")
a = D("a")
j = E("j")
l = F("l")
g = B("g")
c = D("c")
n = E("n")

k.x = h
i.z = l
i.r = l
h.o = i
a.w = l
a.p = n
a.r = i
a.q = g
j.x = a
l.x = j
l.r = g
l.v = g
l.q = a
l.t = h
g.z = l
g.r = l
c.w = l
c.p = j
c.r = g
c.q = g
n.x = c
assert j.x.q.r.x.x.p.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: E = None
        self.r: B = None
        self.q: B = None
        self.txt = txt

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

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

k = A("k")
i = B("i")
h = C("h")
a = D("a")
j = E("j")
l = F("l")
g = B("g")
c = D("c")
n = E("n")

k.x = h
i.z = l
i.r = l
h.o = i
a.w = l
a.p = n
a.r = i
a.q = g
j.x = a
l.x = j
l.r = g
l.v = g
l.q = a
l.t = h
g.z = l
g.r = l
c.w = l
c.p = j
c.r = g
c.q = g
n.x = c
assert j.x.q.r.x.x.p.x.txt == "c"