class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.q: D = None
        self.y: C = None
        self.s: F = None
        self.w: C = None
        self.txt = txt

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

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

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

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

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

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

e = A("e")
h = B("h")
c = C("c")
g = D("g")
l = E("l")
f = F("f")
i = G("i")

e.v = i
e.q = g
e.y = c
e.w = c
e.s = f
h.p = f
h.o = f
c.p = l
c.u = h
c.r = f
g.p = l
l.q = e
l.z = e
l.o = f
l.t = c
l.y = h
f.p = l
f.r = e
i.q = l
i.y = l
i.t = e
i.s = e
i.p = g
assert g.p.z.w.r.p.t.txt == "
class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.q: D = None
        self.y: C = None
        self.s: F = None
        self.w: C = None
        self.txt = txt

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

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

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

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

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

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

e = A("e")
h = B("h")
c = C("c")
g = D("g")
l = E("l")
f = F("f")
i = G("i")

e.v = i
e.q = g
e.y = c
e.w = c
e.s = f
h.p = f
h.o = f
c.p = l
c.u = h
c.r = f
g.p = l
l.q = e
l.z = e
l.o = f
l.t = c
l.y = h
f.p = l
f.r = e
i.q = l
i.y = l
i.t = e
i.s = e
i.p = g
assert g.p.z.w.r.p.t.txt == "c"