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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: E = None
        self.r: F = None
        self.t: A = None
        self.txt = txt

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

e.w = m
e.v = f
h.z = b
h.t = b
h.w = c
b.y = d
b.r = i
b.w = i
b.s = f
b.z = c
b.p = e
i.o = c
i.y = m
i.w = b
c.y = e
c.v = i
d.p = i
d.u = h
a.o = m
a.t = m
a.s = c
a.r = d
m.w = e
m.v = f
f.p = i
f.u = h
assert m.v.u.z.z.y.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: F = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: E = None
        self.r: F = None
        self.t: A = None
        self.txt = txt

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

e.w = m
e.v = f
h.z = b
h.t = b
h.w = c
b.y = d
b.r = i
b.w = i
b.s = f
b.z = c
b.p = e
i.o = c
i.y = m
i.w = b
c.y = e
c.v = i
d.p = i
d.u = h
a.o = m
a.t = m
a.s = c
a.r = d
m.w = e
m.v = f
f.p = i
f.u = h
assert m.v.u.z.z.y.v.u.txt == "h"