class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: G = None
        self.t: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: E = None
        self.p: D = None
        self.x: C = None
        self.r: D = None
        self.v: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: G = None
        self.t: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: E = None
        self.p: D = None
        self.x: C = None
        self.r: D = None
        self.v: A = None
        self.txt = txt

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

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