class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: B = None
        self.q: C = None
        self.x: B = None
        self.u: E = None
        self.r: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.y: B = None
        self.u: F = None
        self.p: D = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.y: B = None
        self.u: F = None
        self.p: D = None
        self.txt = txt

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

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

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

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

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

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