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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: E = None
        self.w: G = None
        self.u: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: G = None
        self.o: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: E = None
        self.w: G = None
        self.u: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: G = None
        self.o: G = None
        self.txt = txt

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

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

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