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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: F = None
        self.txt = txt

g = A("g")
e = B("e")
f = C("f")
l = D("l")
d = E("d")
i = F("i")
b = G("b")
m = H("m")
h = B("h")

g.p = i
g.y = b
e.o = d
e.u = b
f.p = b
f.w = d
l.x = g
l.z = i
l.p = b
l.s = h
d.s = e
d.x = m
i.r = l
i.v = l
i.y = b
i.z = f
b.o = g
b.v = f
b.p = d
b.y = e
m.r = d
m.q = i
h.o = d
h.u = b
assert h.u.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.y: G = None
        self.txt = txt

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: F = None
        self.txt = txt

g = A("g")
e = B("e")
f = C("f")
l = D("l")
d = E("d")
i = F("i")
b = G("b")
m = H("m")
h = B("h")

g.p = i
g.y = b
e.o = d
e.u = b
f.p = b
f.w = d
l.x = g
l.z = i
l.p = b
l.s = h
d.s = e
d.x = m
i.r = l
i.v = l
i.y = b
i.z = f
b.o = g
b.v = f
b.p = d
b.y = e
m.r = d
m.q = i
h.o = d
h.u = b
assert h.u.v.w.txt == "d"