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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: C = None
        self.p: B = None
        self.q: F = None
        self.txt = txt

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

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: C = None
        self.p: B = None
        self.q: F = None
        self.txt = txt

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

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

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

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

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