class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: E = None
        self.v: B = None
        self.w: G = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.x: C = None
        self.y: F = None
        self.z: D = None
        self.txt = txt

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

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

g = A("g")
l = B("l")
e = C("e")
i = D("i")
b = E("b")
n = F("n")
m = G("m")

g.s = i
g.t = b
g.v = l
g.w = m
l.q = n
l.z = e
e.r = l
i.p = n
i.x = n
i.s = l
i.v = e
i.y = m
i.z = b
i.w = g
b.r = m
b.x = e
b.y = n
b.z = i
n.s = i
n.u = i
m.y = n
m.z = e
m.p = b
assert e.r.q.s.p.s.w.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: E = None
        self.v: B = None
        self.w: G = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.x: C = None
        self.y: F = None
        self.z: D = None
        self.txt = txt

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

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

g = A("g")
l = B("l")
e = C("e")
i = D("i")
b = E("b")
n = F("n")
m = G("m")

g.s = i
g.t = b
g.v = l
g.w = m
l.q = n
l.z = e
e.r = l
i.p = n
i.x = n
i.s = l
i.v = e
i.y = m
i.z = b
i.w = g
b.r = m
b.x = e
b.y = n
b.z = i
n.s = i
n.u = i
m.y = n
m.z = e
m.p = b
assert e.r.q.s.p.s.w.s.txt == "i"