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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: D = None
        self.s: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: D = None
        self.s: C = None
        self.txt = txt

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

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

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