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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: D = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: D = None
        self.y: A = None
        self.txt = txt

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

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

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

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