class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: G = None
        self.r: C = None
        self.q: H = None
        self.u: E = None
        self.o: D = None
        self.z: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.q: C = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.q: C = None
        self.p: E = None
        self.txt = txt

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

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

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

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