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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.w: I = None
        self.o: D = None
        self.y: A = None
        self.p: E = None
        self.v: C = None
        self.x: D = None
        self.s: C = None
        self.u: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: I = None
        self.r: F = None
        self.z: D = None
        self.s: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: F = None
        self.o: I = None
        self.x: I = None
        self.z: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

i = A("i")
g = B("g")
c = C("c")
n = D("n")
a = E("a")
d = F("d")
f = G("f")
j = H("j")
b = I("b")

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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.w: I = None
        self.o: D = None
        self.y: A = None
        self.p: E = None
        self.v: C = None
        self.x: D = None
        self.s: C = None
        self.u: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: I = None
        self.r: F = None
        self.z: D = None
        self.s: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: F = None
        self.o: I = None
        self.x: I = None
        self.z: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

i = A("i")
g = B("g")
c = C("c")
n = D("n")
a = E("a")
d = F("d")
f = G("f")
j = H("j")
b = I("b")

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