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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: G = None
        self.q: G = None
        self.o: D = None
        self.y: A = None
        self.z: C = None
        self.p: E = None
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.w: D = None
        self.q: A = None
        self.r: F = None
        self.o: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

i.z = c
i.p = e
f.z = g
f.v = i
g.v = f
g.p = l
c.v = f
e.y = f
d.t = e
d.p = e
d.v = l
d.q = l
d.r = l
d.o = c
d.y = i
d.z = g
l.x = f
l.w = c
l.q = i
l.o = i
l.r = d
m.x = e
assert e.y.z.v.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.p: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: G = None
        self.q: G = None
        self.o: D = None
        self.y: A = None
        self.z: C = None
        self.p: E = None
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.w: D = None
        self.q: A = None
        self.r: F = None
        self.o: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

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