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

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: G = None
        self.q: B = None
        self.p: D = None
        self.txt = txt

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

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

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

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

c = A("c")
e = B("e")
m = C("m")
b = D("b")
k = E("k")
g = F("g")
l = G("l")
d = B("d")
a = A("a")
n = D("n")

c.t = m
c.y = l
c.q = k
e.p = k
e.q = b
e.w = a
e.t = l
m.z = g
m.x = l
m.q = e
m.p = b
b.v = d
b.z = l
k.q = l
k.p = g
k.y = g
g.r = k
g.q = m
g.t = b
l.y = k
d.p = k
d.q = b
d.w = c
d.t = l
a.t = m
a.y = l
a.q = k
n.v = d
n.z = l
assert c.y.y.p.q.p.z.y.y.t.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: G = None
        self.q: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: G = None
        self.q: B = None
        self.p: D = None
        self.txt = txt

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

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

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

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

c = A("c")
e = B("e")
m = C("m")
b = D("b")
k = E("k")
g = F("g")
l = G("l")
d = B("d")
a = A("a")
n = D("n")

c.t = m
c.y = l
c.q = k
e.p = k
e.q = b
e.w = a
e.t = l
m.z = g
m.x = l
m.q = e
m.p = b
b.v = d
b.z = l
k.q = l
k.p = g
k.y = g
g.r = k
g.q = m
g.t = b
l.y = k
d.p = k
d.q = b
d.w = c
d.t = l
a.t = m
a.y = l
a.q = k
n.v = d
n.z = l
assert c.y.y.p.q.p.z.y.y.t.z.txt == "l"