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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: A = None
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: A = None
        self.x: A = None
        self.t: H = None
        self.o: A = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: A = None
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: A = None
        self.x: A = None
        self.t: H = None
        self.o: A = None
        self.txt = txt

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

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

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