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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: A = None
        self.q: H = None
        self.p: H = None
        self.x: A = None
        self.txt = txt

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

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

c.u = f
c.r = g
c.o = d
d.o = l
n.o = f
k.y = j
g.x = f
a.z = d
a.p = l
f.u = d
f.o = c
f.x = c
f.q = j
f.p = j
l.y = k
l.t = k
l.p = n
l.w = c
j.y = k
j.t = k
j.p = n
j.w = c
assert c.r.x.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.r: E = None
        self.o: B = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: A = None
        self.q: H = None
        self.p: H = None
        self.x: A = None
        self.txt = txt

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

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

c.u = f
c.r = g
c.o = d
d.o = l
n.o = f
k.y = j
g.x = f
a.z = d
a.p = l
f.u = d
f.o = c
f.x = c
f.q = j
f.p = j
l.y = k
l.t = k
l.p = n
l.w = c
j.y = k
j.t = k
j.p = n
j.w = c
assert c.r.x.u.txt == "d"