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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: A = None
        self.v: H = None
        self.u: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: E = None
        self.q: E = None
        self.o: D = None
        self.t: C = None
        self.v: C = None
        self.p: D = None
        self.r: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

c.r = l
c.p = d
c.w = i
l.u = i
l.p = f
i.o = m
i.s = m
i.x = m
i.v = m
i.y = d
i.u = f
i.t = e
i.q = c
m.y = l
m.o = f
m.q = d
f.y = m
f.w = c
f.u = c
f.v = d
a.q = l
a.x = f
e.w = m
e.o = m
e.p = m
e.x = f
e.q = f
e.r = f
e.t = i
e.v = i
d.s = l
assert d.s.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: H = None
        self.w: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: A = None
        self.v: H = None
        self.u: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: E = None
        self.q: E = None
        self.o: D = None
        self.t: C = None
        self.v: C = None
        self.p: D = None
        self.r: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

c.r = l
c.p = d
c.w = i
l.u = i
l.p = f
i.o = m
i.s = m
i.x = m
i.v = m
i.y = d
i.u = f
i.t = e
i.q = c
m.y = l
m.o = f
m.q = d
f.y = m
f.w = c
f.u = c
f.v = d
a.q = l
a.x = f
e.w = m
e.o = m
e.p = m
e.x = f
e.q = f
e.r = f
e.t = i
e.v = i
d.s = l
assert d.s.u.u.txt == "f"