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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.y: A = None
        self.q: C = None
        self.p: F = None
        self.o: F = None
        self.z: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: B = None
        self.txt = txt

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

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

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

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

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

l = A("l")
d = B("d")
n = C("n")
k = D("k")
h = E("h")
a = F("a")
g = G("g")
j = H("j")

l.u = k
d.v = g
d.y = l
d.q = n
d.p = a
d.o = a
d.z = j
n.o = k
n.w = d
k.s = g
k.z = g
k.q = a
h.t = j
h.u = k
a.t = d
a.s = h
a.x = j
a.q = j
a.z = n
a.y = g
g.x = k
j.x = g
assert h.u.q.z.o.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.y: A = None
        self.q: C = None
        self.p: F = None
        self.o: F = None
        self.z: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: B = None
        self.txt = txt

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

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

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

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

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

l = A("l")
d = B("d")
n = C("n")
k = D("k")
h = E("h")
a = F("a")
g = G("g")
j = H("j")

l.u = k
d.v = g
d.y = l
d.q = n
d.p = a
d.o = a
d.z = j
n.o = k
n.w = d
k.s = g
k.z = g
k.q = a
h.t = j
h.u = k
a.t = d
a.s = h
a.x = j
a.q = j
a.z = n
a.y = g
g.x = k
j.x = g
assert h.u.q.z.o.q.txt == "a"