class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: H = None
        self.w: G = None
        self.t: C = None
        self.z: F = None
        self.u: H = None
        self.r: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: B = None
        self.p: E = None
        self.o: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: B = None
        self.txt = txt

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

g = A("g")
i = B("i")
f = C("f")
j = D("j")
n = E("n")
l = F("l")
a = G("a")
d = H("d")

g.x = a
g.w = a
g.p = d
g.u = d
g.t = f
g.r = f
g.z = l
i.o = f
i.r = l
f.s = g
f.u = i
f.p = n
f.o = a
j.s = n
n.r = a
n.w = d
n.s = g
l.u = f
l.y = g
l.o = i
a.o = j
a.u = i
d.o = n
assert f.s.t.u.o.txt == "
class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: H = None
        self.w: G = None
        self.t: C = None
        self.z: F = None
        self.u: H = None
        self.r: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: B = None
        self.p: E = None
        self.o: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: B = None
        self.txt = txt

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

g = A("g")
i = B("i")
f = C("f")
j = D("j")
n = E("n")
l = F("l")
a = G("a")
d = H("d")

g.x = a
g.w = a
g.p = d
g.u = d
g.t = f
g.r = f
g.z = l
i.o = f
i.r = l
f.s = g
f.u = i
f.p = n
f.o = a
j.s = n
n.r = a
n.w = d
n.s = g
l.u = f
l.y = g
l.o = i
a.o = j
a.u = i
d.o = n
assert f.s.t.u.o.txt == "f"