class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: C = None
        self.txt = txt

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

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

j.r = l
j.q = l
n.v = a
n.u = i
i.y = a
b.z = n
b.s = l
k.r = h
k.p = i
g.y = i
g.r = n
g.z = k
h.r = l
h.q = l
l.z = n
l.s = b
a.y = i
m.z = n
m.s = b
assert j.r.z.v.y.y.y.y.y.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: C = None
        self.txt = txt

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

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

j.r = l
j.q = l
n.v = a
n.u = i
i.y = a
b.z = n
b.s = l
k.r = h
k.p = i
g.y = i
g.r = n
g.z = k
h.r = l
h.q = l
l.z = n
l.s = b
a.y = i
m.z = n
m.s = b
assert j.r.z.v.y.y.y.y.y.y.y.txt == "i"