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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: C = None
        self.u: F = None
        self.x: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: C = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: C = None
        self.u: F = None
        self.x: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: C = None
        self.txt = txt

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

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

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

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