class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: D = None
        self.z: G = None
        self.o: D = None
        self.u: C = None
        self.t: D = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: D = None
        self.v: E = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: D = None
        self.v: E = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

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

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