class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: D = None
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: E = None
        self.x: B = None
        self.s: E = None
        self.y: F = None
        self.v: G = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: D = None
        self.s: F = None
        self.t: D = None
        self.x: E = None
        self.p: G = None
        self.o: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: E = None
        self.o: F = None
        self.p: E = None
        self.txt = txt

l = A("l")
j = B("j")
a = C("a")
e = D("e")
i = E("i")
h = F("h")
n = G("n")
f = B("f")
b = E("b")

l.y = j
l.q = e
l.r = e
j.p = e
a.s = l
e.r = l
e.u = b
e.s = b
e.x = f
e.y = h
e.v = n
e.t = n
i.u = e
i.q = e
i.t = e
i.s = h
i.o = h
i.x = b
i.p = n
h.t = e
n.s = b
n.q = i
n.p = i
n.o = h
f.p = e
b.u = e
b.q = e
b.t = e
b.s = h
b.o = h
b.x = i
b.p = n
assert h.t.r.q.r.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: D = None
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: E = None
        self.x: B = None
        self.s: E = None
        self.y: F = None
        self.v: G = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: D = None
        self.s: F = None
        self.t: D = None
        self.x: E = None
        self.p: G = None
        self.o: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: E = None
        self.o: F = None
        self.p: E = None
        self.txt = txt

l = A("l")
j = B("j")
a = C("a")
e = D("e")
i = E("i")
h = F("h")
n = G("n")
f = B("f")
b = E("b")

l.y = j
l.q = e
l.r = e
j.p = e
a.s = l
e.r = l
e.u = b
e.s = b
e.x = f
e.y = h
e.v = n
e.t = n
i.u = e
i.q = e
i.t = e
i.s = h
i.o = h
i.x = b
i.p = n
h.t = e
n.s = b
n.q = i
n.p = i
n.o = h
f.p = e
b.u = e
b.q = e
b.t = e
b.s = h
b.o = h
b.x = i
b.p = n
assert h.t.r.q.r.y.txt == "j"