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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: F = None
        self.u: B = None
        self.p: G = None
        self.s: D = None
        self.t: F = None
        self.v: A = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: G = None
        self.o: E = None
        self.r: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: C = None
        self.y: F = None
        self.q: A = None
        self.z: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: F = None
        self.u: B = None
        self.p: G = None
        self.s: D = None
        self.t: F = None
        self.v: A = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: G = None
        self.o: E = None
        self.r: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: C = None
        self.y: F = None
        self.q: A = None
        self.z: C = None
        self.txt = txt

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

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