class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: B = None
        self.r: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.w: A = None
        self.z: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.v: C = None
        self.x: B = None
        self.r: F = None
        self.w: F = None
        self.u: G = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.w: A = None
        self.z: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.v: C = None
        self.x: B = None
        self.r: F = None
        self.w: F = None
        self.u: G = None
        self.txt = txt

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

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

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

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

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