class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: D = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: D = None
        self.txt = txt

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

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

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

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