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

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

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.z: E = None
        self.y: E = None
        self.v: E = None
        self.w: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: H = None
        self.z: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: H = None
        self.s: B = None
        self.r: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: C = None
        self.y: E = None
        self.t: D = None
        self.q: G = None
        self.r: B = None
        self.z: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.z: E = None
        self.y: E = None
        self.v: E = None
        self.w: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: H = None
        self.z: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: H = None
        self.s: B = None
        self.r: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: C = None
        self.y: E = None
        self.t: D = None
        self.q: G = None
        self.r: B = None
        self.z: G = None
        self.txt = txt

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

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