class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: D = None
        self.x: B = None
        self.t: B = None
        self.u: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: H = None
        self.p: E = None
        self.u: B = None
        self.t: A = None
        self.v: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: H = None
        self.p: E = None
        self.u: B = None
        self.t: A = None
        self.v: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

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

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