class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.z: F = None
        self.q: E = None
        self.s: B = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: C = None
        self.s: C = None
        self.q: F = None
        self.u: D = None
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: E = None
        self.q: E = None
        self.p: D = None
        self.z: C = None
        self.txt = txt

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

l.v = b
l.z = m
l.q = f
l.s = d
l.u = n
d.t = e
d.o = e
d.s = n
d.q = m
d.u = g
d.y = l
n.q = g
g.u = d
i.o = f
i.p = d
m.u = e
m.v = l
b.u = e
b.o = f
b.q = i
b.p = g
b.z = n
e.q = g
f.o = i
f.p = d
assert i.o.p.y.u.q.txt == "
class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.z: F = None
        self.q: E = None
        self.s: B = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: C = None
        self.s: C = None
        self.q: F = None
        self.u: D = None
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: E = None
        self.q: E = None
        self.p: D = None
        self.z: C = None
        self.txt = txt

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

l.v = b
l.z = m
l.q = f
l.s = d
l.u = n
d.t = e
d.o = e
d.s = n
d.q = m
d.u = g
d.y = l
n.q = g
g.u = d
i.o = f
i.p = d
m.u = e
m.v = l
b.u = e
b.o = f
b.q = i
b.p = g
b.z = n
e.q = g
f.o = i
f.p = d
assert i.o.p.y.u.q.txt == "g"