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

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

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: H = None
        self.v: G = None
        self.o: H = None
        self.u: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: H = None
        self.p: D = None
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.u: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.u: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: H = None
        self.v: G = None
        self.o: H = None
        self.u: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: H = None
        self.p: D = None
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.u: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.u: E = None
        self.txt = txt

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

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