class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: E = None
        self.y: B = None
        self.q: H = None
        self.v: E = None
        self.w: C = None
        self.s: F = None
        self.u: B = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.r: A = None
        self.y: H = None
        self.x: B = None
        self.t: B = None
        self.q: G = None
        self.o: H = None
        self.txt = txt

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

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

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

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

d.x = h
d.t = j
d.v = j
d.y = a
d.u = a
d.q = c
d.w = f
d.s = m
a.x = d
a.q = j
n.u = h
n.r = c
n.q = d
g.w = c
j.t = g
m.u = c
m.y = c
m.o = c
m.r = d
m.x = a
m.t = a
m.q = h
h.q = g
h.s = c
c.s = g
k.u = d
k.t = j
k.r = n
f.u = h
f.r = c
f.q = d
assert m.t.x.x.q.txt == "
class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: E = None
        self.y: B = None
        self.q: H = None
        self.v: E = None
        self.w: C = None
        self.s: F = None
        self.u: B = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.r: A = None
        self.y: H = None
        self.x: B = None
        self.t: B = None
        self.q: G = None
        self.o: H = None
        self.txt = txt

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

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

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

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

d.x = h
d.t = j
d.v = j
d.y = a
d.u = a
d.q = c
d.w = f
d.s = m
a.x = d
a.q = j
n.u = h
n.r = c
n.q = d
g.w = c
j.t = g
m.u = c
m.y = c
m.o = c
m.r = d
m.x = a
m.t = a
m.q = h
h.q = g
h.s = c
c.s = g
k.u = d
k.t = j
k.r = n
f.u = h
f.r = c
f.q = d
assert m.t.x.x.q.txt == "g"