class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: D = None
        self.x: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: E = None
        self.p: A = None
        self.r: G = None
        self.z: A = None
        self.o: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: A = None
        self.u: E = None
        self.t: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: F = None
        self.u: E = None
        self.s: C = None
        self.t: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: E = None
        self.p: A = None
        self.r: G = None
        self.z: A = None
        self.o: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: A = None
        self.u: E = None
        self.t: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: F = None
        self.u: E = None
        self.s: C = None
        self.t: A = None
        self.txt = txt

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

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