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

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: E = None
        self.y: D = None
        self.q: B = None
        self.o: F = None
        self.p: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: C = None
        self.x: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: E = None
        self.y: D = None
        self.q: B = None
        self.o: F = None
        self.p: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: C = None
        self.x: E = None
        self.txt = txt

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

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