class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: F = None
        self.z: E = None
        self.x: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: E = None
        self.z: C = None
        self.x: F = None
        self.txt = txt

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

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

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

k.r = h
i.v = k
i.p = a
i.z = e
i.x = h
f.w = d
f.y = i
f.v = l
f.p = l
f.z = k
h.o = f
d.w = e
d.z = f
d.x = a
a.z = i
a.w = i
a.p = i
l.v = i
l.w = h
c.z = i
c.w = i
c.p = i
e.w = d
e.z = f
e.x = a
assert i.v.r.o.z.r.o.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: F = None
        self.z: E = None
        self.x: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: E = None
        self.z: C = None
        self.x: F = None
        self.txt = txt

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

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

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

k.r = h
i.v = k
i.p = a
i.z = e
i.x = h
f.w = d
f.y = i
f.v = l
f.p = l
f.z = k
h.o = f
d.w = e
d.z = f
d.x = a
a.z = i
a.w = i
a.p = i
l.v = i
l.w = h
c.z = i
c.w = i
c.p = i
e.w = d
e.z = f
e.x = a
assert i.v.r.o.z.r.o.w.w.txt == "e"