class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: A = None
        self.t: E = None
        self.q: E = None
        self.u: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: A = None
        self.s: A = None
        self.x: D = None
        self.r: D = None
        self.txt = txt

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

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

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

h.v = a
g.p = a
g.t = a
g.q = a
g.v = h
g.u = i
m.q = h
k.y = h
k.t = l
k.s = l
k.x = i
k.r = i
a.s = f
f.u = a
f.s = a
i.y = l
i.t = l
i.s = l
i.x = k
i.r = k
l.v = a
assert m.q.v.s.s.s.u.s.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: A = None
        self.t: E = None
        self.q: E = None
        self.u: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: A = None
        self.s: A = None
        self.x: D = None
        self.r: D = None
        self.txt = txt

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

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

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

h.v = a
g.p = a
g.t = a
g.q = a
g.v = h
g.u = i
m.q = h
k.y = h
k.t = l
k.s = l
k.x = i
k.r = i
a.s = f
f.u = a
f.s = a
i.y = l
i.t = l
i.s = l
i.x = k
i.r = k
l.v = a
assert m.q.v.s.s.s.u.s.u.txt == "a"