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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.q: B = None
        self.t: A = None
        self.z: B = None
        self.o: D = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.v: E = None
        self.y: F = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.q: B = None
        self.t: A = None
        self.z: B = None
        self.o: D = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.v: E = None
        self.y: F = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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