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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: D = None
        self.r: E = None
        self.w: B = None
        self.s: A = None
        self.q: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: A = None
        self.z: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: D = None
        self.r: E = None
        self.w: B = None
        self.s: A = None
        self.q: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: A = None
        self.z: E = None
        self.txt = txt

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

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