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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: G = None
        self.z: G = None
        self.p: E = None
        self.s: G = None
        self.q: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: A = None
        self.p: A = None
        self.y: A = None
        self.w: G = None
        self.t: A = None
        self.u: E = None
        self.txt = txt

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

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

k = A("k")
i = B("i")
f = C("f")
h = D("h")
b = E("b")
j = F("j")
c = G("c")
g = B("g")
a = E("a")

k.p = h
k.w = b
k.z = c
k.r = g
k.u = g
k.x = i
k.y = a
i.r = h
f.u = c
f.o = h
h.v = g
h.t = c
h.z = c
h.s = c
h.p = b
h.q = j
b.s = k
b.x = k
b.p = k
b.y = k
b.t = k
b.w = c
b.u = a
j.t = k
c.w = f
c.r = f
c.x = k
c.t = j
c.z = g
g.r = h
a.s = k
a.x = k
a.p = k
a.y = k
a.t = k
a.w = c
a.u = b
assert f.u.z.r.s.z.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: E = None
        self.z: G = None
        self.r: B = None
        self.x: B = None
        self.u: B = None
        self.y: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: G = None
        self.z: G = None
        self.p: E = None
        self.s: G = None
        self.q: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: A = None
        self.p: A = None
        self.y: A = None
        self.w: G = None
        self.t: A = None
        self.u: E = None
        self.txt = txt

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

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

k = A("k")
i = B("i")
f = C("f")
h = D("h")
b = E("b")
j = F("j")
c = G("c")
g = B("g")
a = E("a")

k.p = h
k.w = b
k.z = c
k.r = g
k.u = g
k.x = i
k.y = a
i.r = h
f.u = c
f.o = h
h.v = g
h.t = c
h.z = c
h.s = c
h.p = b
h.q = j
b.s = k
b.x = k
b.p = k
b.y = k
b.t = k
b.w = c
b.u = a
j.t = k
c.w = f
c.r = f
c.x = k
c.t = j
c.z = g
g.r = h
a.s = k
a.x = k
a.p = k
a.y = k
a.t = k
a.w = c
a.u = b
assert f.u.z.r.s.z.txt == "g"