class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.v: D = None
        self.y: B = None
        self.o: F = None
        self.s: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: E = None
        self.v: G = None
        self.q: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: I = None
        self.p: G = None
        self.t: B = None
        self.y: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: I = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.o: D = None
        self.r: C = None
        self.v: E = None
        self.u: E = None
        self.q: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

c = A("c")
d = B("d")
f = C("f")
k = D("k")
l = E("l")
b = F("b")
i = G("i")
h = H("h")
m = I("m")

c.q = i
c.s = i
c.v = k
c.y = d
c.o = b
d.r = c
d.t = l
d.v = i
d.q = h
f.x = m
f.p = i
f.t = d
f.y = b
k.u = d
l.y = m
l.q = f
b.s = d
b.o = k
b.q = k
b.r = f
b.v = l
b.u = l
i.q = h
h.t = d
m.o = c
m.s = l
m.y = b
assert d.t.q.p.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.v: D = None
        self.y: B = None
        self.o: F = None
        self.s: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: E = None
        self.v: G = None
        self.q: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: I = None
        self.p: G = None
        self.t: B = None
        self.y: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: I = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.o: D = None
        self.r: C = None
        self.v: E = None
        self.u: E = None
        self.q: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

c = A("c")
d = B("d")
f = C("f")
k = D("k")
l = E("l")
b = F("b")
i = G("i")
h = H("h")
m = I("m")

c.q = i
c.s = i
c.v = k
c.y = d
c.o = b
d.r = c
d.t = l
d.v = i
d.q = h
f.x = m
f.p = i
f.t = d
f.y = b
k.u = d
l.y = m
l.q = f
b.s = d
b.o = k
b.q = k
b.r = f
b.v = l
b.u = l
i.q = h
h.t = d
m.o = c
m.s = l
m.y = b
assert d.t.q.p.q.txt == "h"