class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: A = None
        self.s: A = None
        self.o: B = None
        self.y: B = None
        self.r: A = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: B = None
        self.y: A = None
        self.w: A = None
        self.v: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: A = None
        self.s: A = None
        self.o: B = None
        self.y: B = None
        self.r: A = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: B = None
        self.y: A = None
        self.w: A = None
        self.v: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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

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

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