class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: C = None
        self.v: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: D = None
        self.t: E = None
        self.y: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: E = None
        self.o: G = None
        self.p: G = None
        self.y: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: A = None
        self.u: G = None
        self.txt = txt

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

j = A("j")
e = B("e")
i = C("i")
g = D("g")
a = E("a")
l = F("l")
k = G("k")
h = D("h")

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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: D = None
        self.t: E = None
        self.y: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: E = None
        self.o: G = None
        self.p: G = None
        self.y: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: A = None
        self.u: G = None
        self.txt = txt

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

j = A("j")
e = B("e")
i = C("i")
g = D("g")
a = E("a")
l = F("l")
k = G("k")
h = D("h")

j.o = h
j.s = i
j.v = l
e.u = h
e.y = g
i.r = a
i.t = a
i.u = g
i.y = e
g.x = j
g.v = a
g.o = k
g.p = k
g.y = l
a.w = j
l.v = k
l.u = k
l.x = j
k.q = i
h.x = j
h.v = a
h.o = k
h.p = k
h.y = l
assert j.s.t.w.o.txt == "h"