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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: H = None
        self.t: A = None
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: H = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: B = None
        self.r: E = None
        self.y: F = None
        self.q: A = None
        self.txt = txt

h = A("h")
a = B("a")
e = C("e")
j = D("j")
d = E("d")
c = F("c")
i = G("i")
n = H("n")
l = I("l")

h.x = n
a.x = h
a.t = h
a.y = n
a.r = e
e.t = c
e.w = n
j.t = c
d.r = a
d.x = j
c.q = j
i.x = d
i.q = c
i.u = l
i.z = l
i.r = a
i.p = n
n.w = j
l.o = d
l.r = d
l.u = a
l.y = c
l.q = h
assert a.y.w.t.txt == "
class A:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: H = None
        self.t: A = None
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: H = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: B = None
        self.r: E = None
        self.y: F = None
        self.q: A = None
        self.txt = txt

h = A("h")
a = B("a")
e = C("e")
j = D("j")
d = E("d")
c = F("c")
i = G("i")
n = H("n")
l = I("l")

h.x = n
a.x = h
a.t = h
a.y = n
a.r = e
e.t = c
e.w = n
j.t = c
d.r = a
d.x = j
c.q = j
i.x = d
i.q = c
i.u = l
i.z = l
i.r = a
i.p = n
n.w = j
l.o = d
l.r = d
l.u = a
l.y = c
l.q = h
assert a.y.w.t.txt == "c"