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

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: D = None
        self.v: D = None
        self.w: B = None
        self.x: B = None
        self.t: A = None
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

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

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

a = A("a")
h = B("h")
f = C("f")
g = D("g")
j = E("j")
m = F("m")
b = G("b")
i = C("i")

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

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: D = None
        self.v: D = None
        self.w: B = None
        self.x: B = None
        self.t: A = None
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

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

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

a = A("a")
h = B("h")
f = C("f")
g = D("g")
j = E("j")
m = F("m")
b = G("b")
i = C("i")

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