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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: H = None
        self.t: F = None
        self.q: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.w: A = None
        self.y: B = None
        self.p: A = None
        self.z: B = None
        self.s: B = None
        self.u: E = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: H = None
        self.t: F = None
        self.q: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.w: A = None
        self.y: B = None
        self.p: A = None
        self.z: B = None
        self.s: B = None
        self.u: E = None
        self.q: B = None
        self.txt = txt

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

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

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

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