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

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

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: A = None
        self.o: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: F = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: A = None
        self.o: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: F = None
        self.txt = txt

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

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

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

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