class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: E = None
        self.y: G = None
        self.p: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: A = None
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: B = None
        self.p: F = None
        self.u: F = None
        self.r: C = None
        self.y: B = None
        self.t: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: A = None
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: B = None
        self.p: F = None
        self.u: F = None
        self.r: C = None
        self.y: B = None
        self.t: F = None
        self.txt = txt

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

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