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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: A = None
        self.w: G = None
        self.q: C = None
        self.s: C = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: A = None
        self.p: A = None
        self.txt = txt

g = A("g")
j = B("j")
a = C("a")
c = D("c")
m = E("m")
f = F("f")
n = G("n")
e = F("e")
i = B("i")
l = F("l")

g.x = c
g.r = n
g.t = f
j.v = g
j.p = g
j.w = n
j.q = a
j.s = a
a.x = i
a.y = g
a.u = j
c.w = g
c.q = a
c.u = i
m.z = e
f.u = g
f.p = e
f.z = m
n.q = i
n.x = g
n.p = g
e.u = g
e.p = f
e.z = m
i.v = g
i.p = g
i.w = n
i.q = a
i.s = a
l.u = g
l.p = f
l.z = m
assert a.x.w.p.r.q.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: G = None
        self.t: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: A = None
        self.w: G = None
        self.q: C = None
        self.s: C = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: A = None
        self.p: A = None
        self.txt = txt

g = A("g")
j = B("j")
a = C("a")
c = D("c")
m = E("m")
f = F("f")
n = G("n")
e = F("e")
i = B("i")
l = F("l")

g.x = c
g.r = n
g.t = f
j.v = g
j.p = g
j.w = n
j.q = a
j.s = a
a.x = i
a.y = g
a.u = j
c.w = g
c.q = a
c.u = i
m.z = e
f.u = g
f.p = e
f.z = m
n.q = i
n.x = g
n.p = g
e.u = g
e.p = f
e.z = m
i.v = g
i.p = g
i.w = n
i.q = a
i.s = a
l.u = g
l.p = f
l.z = m
assert a.x.w.p.r.q.txt == "i"