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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: A = None
        self.v: A = None
        self.p: G = None
        self.y: E = None
        self.x: D = None
        self.q: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: H = None
        self.t: D = None
        self.x: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

h = A("h")
i = B("i")
n = C("n")
b = D("b")
d = E("d")
g = F("g")
a = G("a")
e = H("e")
l = C("l")

h.r = i
i.q = l
n.s = i
n.q = i
n.t = h
n.v = h
n.p = a
n.y = d
n.x = b
b.q = h
b.t = d
b.z = i
d.v = a
d.p = e
d.y = i
g.v = n
g.y = e
a.p = d
a.z = e
a.t = b
a.x = h
e.q = g
l.s = i
l.q = i
l.t = h
l.v = h
l.p = a
l.y = d
l.x = b
assert e.q.v.p.t.t.y.q.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: A = None
        self.v: A = None
        self.p: G = None
        self.y: E = None
        self.x: D = None
        self.q: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: H = None
        self.t: D = None
        self.x: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

h = A("h")
i = B("i")
n = C("n")
b = D("b")
d = E("d")
g = F("g")
a = G("a")
e = H("e")
l = C("l")

h.r = i
i.q = l
n.s = i
n.q = i
n.t = h
n.v = h
n.p = a
n.y = d
n.x = b
b.q = h
b.t = d
b.z = i
d.v = a
d.p = e
d.y = i
g.v = n
g.y = e
a.p = d
a.z = e
a.t = b
a.x = h
e.q = g
l.s = i
l.q = i
l.t = h
l.v = h
l.p = a
l.y = d
l.x = b
assert e.q.v.p.t.t.y.q.txt == "l"