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

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

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

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.v: C = None
        self.u: A = None
        self.t: E = None
        self.w: E = None
        self.q: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: B = None
        self.p: D = None
        self.t: G = None
        self.v: E = None
        self.w: B = None
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: C = None
        self.q: D = None
        self.w: C = None
        self.x: B = None
        self.txt = txt

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

f = A("f")
i = B("i")
h = C("h")
d = D("d")
k = E("k")
c = F("c")
g = G("g")
m = D("m")
n = E("n")
l = C("l")

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.v: C = None
        self.u: A = None
        self.t: E = None
        self.w: E = None
        self.q: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: B = None
        self.p: D = None
        self.t: G = None
        self.v: E = None
        self.w: B = None
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: C = None
        self.q: D = None
        self.w: C = None
        self.x: B = None
        self.txt = txt

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

f = A("f")
i = B("i")
h = C("h")
d = D("d")
k = E("k")
c = F("c")
g = G("g")
m = D("m")
n = E("n")
l = C("l")

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