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

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: F = None
        self.u: B = None
        self.v: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: H = None
        self.y: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: C = None
        self.t: A = None
        self.w: D = None
        self.s: D = None
        self.u: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: F = None
        self.u: B = None
        self.v: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: H = None
        self.y: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: C = None
        self.t: A = None
        self.w: D = None
        self.s: D = None
        self.u: D = None
        self.txt = txt

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

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

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