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

class B:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: D = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: D = None
        self.o: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: C = None
        self.q: B = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: C = None
        self.x: E = None
        self.p: E = None
        self.txt = txt

a = A("a")
b = B("b")
d = C("d")
n = D("n")
c = E("c")
f = F("f")
k = G("k")
g = B("g")

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

class B:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: D = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: D = None
        self.o: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: C = None
        self.q: B = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: C = None
        self.x: E = None
        self.p: E = None
        self.txt = txt

a = A("a")
b = B("b")
d = C("d")
n = D("n")
c = E("c")
f = F("f")
k = G("k")
g = B("g")

a.w = k
a.x = f
a.t = d
a.s = c
a.r = g
b.p = g
b.s = n
b.o = c
d.t = f
d.s = n
d.o = n
n.s = d
n.w = c
n.x = c
n.v = b
n.z = b
n.r = k
n.u = k
c.s = k
c.q = d
f.r = a
f.u = d
f.q = g
f.o = n
k.z = d
k.u = d
k.x = c
k.p = c
g.p = b
g.s = n
g.o = c
assert f.q.o.q.t.r.t.t.r.txt == "a"