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

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

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: A = None
        self.y: G = None
        self.txt = txt

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

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

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

g.t = m
k.w = c
k.s = f
k.y = g
b.r = c
m.p = g
m.s = n
m.t = n
m.w = k
m.x = b
m.y = b
f.o = k
f.y = i
f.x = n
f.s = b
i.p = m
i.x = g
i.y = n
n.u = f
n.y = i
n.t = b
n.p = m
n.x = m
c.v = i
c.s = g
c.t = m
assert n.x.p.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: A = None
        self.y: G = None
        self.txt = txt

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

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

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

g.t = m
k.w = c
k.s = f
k.y = g
b.r = c
m.p = g
m.s = n
m.t = n
m.w = k
m.x = b
m.y = b
f.o = k
f.y = i
f.x = n
f.s = b
i.p = m
i.x = g
i.y = n
n.u = f
n.y = i
n.t = b
n.p = m
n.x = m
c.v = i
c.s = g
c.t = m
assert n.x.p.t.txt == "m"