class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: G = None
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: D = None
        self.o: E = None
        self.x: C = None
        self.p: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: F = None
        self.t: D = None
        self.txt = txt

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

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

l = A("l")
j = B("j")
k = C("k")
d = D("d")
m = E("m")
i = F("i")
g = G("g")

l.t = j
l.o = j
l.x = g
j.y = l
j.z = d
j.o = m
j.x = k
j.p = g
k.y = d
k.r = m
k.x = l
d.r = j
d.z = j
d.x = g
d.q = g
d.s = l
d.t = m
m.w = d
m.t = d
m.p = i
i.o = d
i.q = d
i.v = g
i.x = m
i.u = m
g.w = k
assert i.x.p.x.t.x.w.r.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: G = None
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: D = None
        self.o: E = None
        self.x: C = None
        self.p: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: F = None
        self.t: D = None
        self.txt = txt

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

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

l = A("l")
j = B("j")
k = C("k")
d = D("d")
m = E("m")
i = F("i")
g = G("g")

l.t = j
l.o = j
l.x = g
j.y = l
j.z = d
j.o = m
j.x = k
j.p = g
k.y = d
k.r = m
k.x = l
d.r = j
d.z = j
d.x = g
d.q = g
d.s = l
d.t = m
m.w = d
m.t = d
m.p = i
i.o = d
i.q = d
i.v = g
i.x = m
i.u = m
g.w = k
assert i.x.p.x.t.x.w.r.txt == "m"