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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: D = None
        self.z: G = None
        self.x: G = None
        self.r: A = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.x: B = None
        self.s: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: B = None
        self.q: G = None
        self.y: D = None
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: E = None
        self.x: G = None
        self.s: D = None
        self.y: F = None
        self.w: G = None
        self.u: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: D = None
        self.z: G = None
        self.x: G = None
        self.r: A = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.x: B = None
        self.s: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: B = None
        self.q: G = None
        self.y: D = None
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: E = None
        self.x: G = None
        self.s: D = None
        self.y: F = None
        self.w: G = None
        self.u: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: E = None
        self.txt = txt

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

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