class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: E = None
        self.v: C = None
        self.x: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: E = None
        self.y: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: E = None
        self.q: E = None
        self.x: E = None
        self.txt = txt

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

m.y = b
m.s = f
m.v = k
m.x = k
g.r = n
k.w = n
k.v = l
n.t = f
n.q = f
n.y = l
f.r = l
l.s = f
l.o = f
l.q = f
l.x = f
i.t = f
i.q = f
i.y = b
b.s = f
b.o = f
b.q = f
b.x = f
assert k.w.y.q.r.x.r.x.r.txt == "
class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: E = None
        self.v: C = None
        self.x: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: E = None
        self.y: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: E = None
        self.q: E = None
        self.x: E = None
        self.txt = txt

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

m.y = b
m.s = f
m.v = k
m.x = k
g.r = n
k.w = n
k.v = l
n.t = f
n.q = f
n.y = l
f.r = l
l.s = f
l.o = f
l.q = f
l.x = f
i.t = f
i.q = f
i.y = b
b.s = f
b.o = f
b.q = f
b.x = f
assert k.w.y.q.r.x.r.x.r.txt == "l"