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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

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