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

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

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.u: B = None
        self.y: F = None
        self.r: H = None
        self.x: G = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.t: A = None
        self.x: H = None
        self.o: H = None
        self.txt = txt

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

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

d = A("d")
f = B("f")
e = C("e")
k = D("k")
a = E("a")
l = F("l")
i = G("i")
j = H("j")

d.r = i
d.w = e
d.p = f
d.t = l
d.y = j
f.t = k
e.y = f
e.w = i
e.p = j
k.w = i
k.x = i
k.u = f
k.p = f
k.y = l
k.r = j
a.v = j
l.w = i
l.t = d
l.x = j
l.o = j
i.x = f
i.v = a
j.s = l
j.o = a
j.r = a
j.y = a
assert j.s.t.r.x.t.w.txt == "
class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.w: C = None
        self.p: B = None
        self.t: F = None
        self.y: H = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.u: B = None
        self.y: F = None
        self.r: H = None
        self.x: G = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.t: A = None
        self.x: H = None
        self.o: H = None
        self.txt = txt

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

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

d = A("d")
f = B("f")
e = C("e")
k = D("k")
a = E("a")
l = F("l")
i = G("i")
j = H("j")

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