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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: H = None
        self.p: D = None
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: D = None
        self.s: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: D = None
        self.p: C = None
        self.txt = txt

m = A("m")
f = B("f")
n = C("n")
c = D("c")
g = E("g")
l = F("l")
j = G("j")
a = H("a")

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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: H = None
        self.p: D = None
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: D = None
        self.s: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: D = None
        self.p: C = None
        self.txt = txt

m = A("m")
f = B("f")
n = C("n")
c = D("c")
g = E("g")
l = F("l")
j = G("j")
a = H("a")

m.x = l
m.q = c
m.z = f
m.s = f
f.t = n
f.w = a
f.p = c
f.s = g
n.w = f
c.t = m
c.x = m
c.y = a
c.p = f
c.u = g
g.u = f
g.w = c
g.s = n
l.p = f
l.t = f
l.r = f
l.v = a
j.v = m
j.q = m
j.p = l
j.r = g
j.s = c
a.t = m
a.w = c
a.p = n
assert g.u.p.u.txt == "g"