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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.u: H = None
        self.x: C = None
        self.p: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: B = None
        self.txt = txt

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

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

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

b.r = k
b.t = g
b.p = j
b.s = i
g.v = j
g.u = i
g.p = i
g.x = m
m.x = g
m.t = f
f.y = g
k.x = i
k.r = f
k.s = g
k.p = j
d.q = g
d.w = g
j.w = i
j.p = k
j.y = m
j.x = f
j.z = b
i.t = f
assert f.y.x.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: B = None
        self.p: G = None
        self.s: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.u: H = None
        self.x: C = None
        self.p: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: B = None
        self.txt = txt

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

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

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

b.r = k
b.t = g
b.p = j
b.s = i
g.v = j
g.u = i
g.p = i
g.x = m
m.x = g
m.t = f
f.y = g
k.x = i
k.r = f
k.s = g
k.p = j
d.q = g
d.w = g
j.w = i
j.p = k
j.y = m
j.x = f
j.z = b
i.t = f
assert f.y.x.t.txt == "f"