class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.w: C = None
        self.x: E = None
        self.p: F = None
        self.s: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.q: G = None
        self.r: F = None
        self.v: B = None
        self.t: B = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: D = None
        self.r: A = None
        self.p: D = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: G = None
        self.v: E = None
        self.p: A = None
        self.z: G = None
        self.x: D = None
        self.txt = txt

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

d = A("d")
l = B("l")
k = C("k")
c = D("c")
h = E("h")
b = F("b")
n = G("n")

d.z = n
d.w = k
d.x = h
d.p = b
d.s = l
l.t = n
l.o = d
k.z = c
k.u = c
k.s = d
k.v = l
k.w = l
k.x = n
k.p = n
c.z = n
c.q = n
c.r = b
c.v = l
c.t = l
c.y = k
h.v = n
h.o = c
h.p = c
h.r = d
h.s = d
b.y = d
b.p = d
b.u = n
b.z = n
b.v = h
b.x = c
n.v = k
n.y = k
n.w = b
n.q = c
assert d.z.w.p.z.w.u.q.txt == "
class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.w: C = None
        self.x: E = None
        self.p: F = None
        self.s: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.q: G = None
        self.r: F = None
        self.v: B = None
        self.t: B = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: D = None
        self.r: A = None
        self.p: D = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: G = None
        self.v: E = None
        self.p: A = None
        self.z: G = None
        self.x: D = None
        self.txt = txt

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

d = A("d")
l = B("l")
k = C("k")
c = D("c")
h = E("h")
b = F("b")
n = G("n")

d.z = n
d.w = k
d.x = h
d.p = b
d.s = l
l.t = n
l.o = d
k.z = c
k.u = c
k.s = d
k.v = l
k.w = l
k.x = n
k.p = n
c.z = n
c.q = n
c.r = b
c.v = l
c.t = l
c.y = k
h.v = n
h.o = c
h.p = c
h.r = d
h.s = d
b.y = d
b.p = d
b.u = n
b.z = n
b.v = h
b.x = c
n.v = k
n.y = k
n.w = b
n.q = c
assert d.z.w.p.z.w.u.q.txt == "c"