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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: F = None
        self.t: E = None
        self.o: D = None
        self.y: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: F = None
        self.t: E = None
        self.o: D = None
        self.y: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: F = None
        self.txt = txt

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

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