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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: C = None
        self.r: F = None
        self.u: F = None
        self.z: F = None
        self.y: C = None
        self.p: G = None
        self.txt = txt

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

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

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

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

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

a = A("a")
g = B("g")
k = C("k")
c = D("c")
j = E("j")
h = F("h")
e = G("e")
d = G("d")
m = E("m")
f = D("f")

a.r = j
a.w = h
a.v = f
a.u = f
a.z = k
a.p = e
a.x = c
g.v = a
g.o = k
g.y = k
g.r = h
g.u = h
g.z = h
g.p = e
k.q = c
k.z = a
c.r = d
c.p = e
c.x = e
c.w = a
c.q = a
c.v = f
c.y = k
j.w = g
h.w = k
e.x = h
e.v = j
e.w = k
e.z = d
e.q = a
d.x = h
d.v = m
d.w = k
d.z = e
d.q = a
m.w = g
f.r = d
f.x = d
f.p = e
f.w = a
f.q = a
f.v = c
f.y = k
assert g.p.w.z.v.y.z.w.w.q.v.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: F = None
        self.v: D = None
        self.z: C = None
        self.p: G = None
        self.u: D = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: C = None
        self.r: F = None
        self.u: F = None
        self.z: F = None
        self.y: C = None
        self.p: G = None
        self.txt = txt

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

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

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

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

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

a = A("a")
g = B("g")
k = C("k")
c = D("c")
j = E("j")
h = F("h")
e = G("e")
d = G("d")
m = E("m")
f = D("f")

a.r = j
a.w = h
a.v = f
a.u = f
a.z = k
a.p = e
a.x = c
g.v = a
g.o = k
g.y = k
g.r = h
g.u = h
g.z = h
g.p = e
k.q = c
k.z = a
c.r = d
c.p = e
c.x = e
c.w = a
c.q = a
c.v = f
c.y = k
j.w = g
h.w = k
e.x = h
e.v = j
e.w = k
e.z = d
e.q = a
d.x = h
d.v = m
d.w = k
d.z = e
d.q = a
m.w = g
f.r = d
f.x = d
f.p = e
f.w = a
f.q = a
f.v = c
f.y = k
assert g.p.w.z.v.y.z.w.w.q.v.txt == "f"