class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: H = None
        self.w: C = None
        self.s: G = None
        self.x: F = None
        self.y: H = None
        self.r: G = None
        self.txt = txt

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: D = None
        self.r: A = None
        self.u: D = None
        self.txt = txt

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

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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: D = None
        self.r: A = None
        self.u: D = None
        self.txt = txt

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

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