class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.r: A = None
        self.q: G = None
        self.o: D = None
        self.v: H = None
        self.u: G = None
        self.s: G = None
        self.t: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

l.p = i
d.s = g
c.t = f
c.x = f
c.p = f
c.q = b
c.v = i
b.s = f
b.v = a
b.o = g
b.w = l
b.x = c
b.r = d
i.z = f
i.q = f
i.u = f
i.s = f
i.r = l
i.o = b
i.t = b
i.v = g
a.u = d
a.r = l
a.t = f
a.w = c
a.z = g
f.u = l
g.w = f
g.s = c
assert f.u.p.r.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.r: A = None
        self.q: G = None
        self.o: D = None
        self.v: H = None
        self.u: G = None
        self.s: G = None
        self.t: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

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