class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.u: F = None
        self.t: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: E = None
        self.u: F = None
        self.y: A = None
        self.r: F = None
        self.s: F = None
        self.v: E = None
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.v: C = None
        self.w: B = None
        self.x: H = None
        self.y: A = None
        self.r: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: H = None
        self.y: B = None
        self.p: C = None
        self.z: A = None
        self.v: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.o: C = None
        self.s: A = None
        self.v: G = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: E = None
        self.u: F = None
        self.y: A = None
        self.r: F = None
        self.s: F = None
        self.v: E = None
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.v: C = None
        self.w: B = None
        self.x: H = None
        self.y: A = None
        self.r: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: H = None
        self.y: B = None
        self.p: C = None
        self.z: A = None
        self.v: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.o: C = None
        self.s: A = None
        self.v: G = None
        self.p: E = None
        self.txt = txt

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

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

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

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