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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.x: B = None
        self.q: D = None
        self.t: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.x: B = None
        self.q: D = None
        self.t: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

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

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