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

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

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: F = None
        self.u: A = None
        self.q: E = None
        self.o: B = None
        self.r: B = None
        self.txt = txt

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

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

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

h.p = g
h.v = m
h.w = c
h.q = c
h.u = a
h.r = i
g.w = m
c.t = h
i.p = g
i.o = g
i.r = g
i.y = m
i.u = b
i.q = j
j.s = b
m.t = l
m.w = g
b.p = g
b.v = a
b.u = a
b.w = c
b.q = c
b.r = l
e.t = i
e.w = g
a.t = i
a.w = g
l.p = g
l.o = g
l.r = g
l.y = m
l.u = b
l.q = j
assert i.q.s.r.y.w.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: F = None
        self.w: C = None
        self.u: F = None
        self.r: D = None
        self.q: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: F = None
        self.u: A = None
        self.q: E = None
        self.o: B = None
        self.r: B = None
        self.txt = txt

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

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

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

h.p = g
h.v = m
h.w = c
h.q = c
h.u = a
h.r = i
g.w = m
c.t = h
i.p = g
i.o = g
i.r = g
i.y = m
i.u = b
i.q = j
j.s = b
m.t = l
m.w = g
b.p = g
b.v = a
b.u = a
b.w = c
b.q = c
b.r = l
e.t = i
e.w = g
a.t = i
a.w = g
l.p = g
l.o = g
l.r = g
l.y = m
l.u = b
l.q = j
assert i.q.s.r.y.w.txt == "g"