class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: D = None
        self.u: H = None
        self.o: D = None
        self.y: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.q: H = None
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.q: D = None
        self.x: D = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.q: H = None
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.q: D = None
        self.x: D = None
        self.v: C = None
        self.txt = txt

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

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

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