class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: D = None
        self.y: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: E = None
        self.o: D = None
        self.w: C = None
        self.v: G = None
        self.q: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: B = None
        self.o: D = None
        self.txt = txt

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

e = A("e")
f = B("f")
j = C("j")
b = D("b")
l = E("l")
d = F("d")
m = G("m")
c = D("c")
k = G("k")
h = F("h")

e.u = b
e.o = c
e.y = d
f.u = d
j.p = f
j.q = e
b.r = j
b.w = j
b.p = l
b.q = l
b.o = c
b.v = k
l.p = e
l.x = e
d.v = h
d.u = f
d.o = c
m.w = k
c.r = j
c.w = j
c.p = l
c.q = l
c.o = b
c.v = m
k.w = m
h.v = d
h.u = f
h.o = c
assert j.p.u.o.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: D = None
        self.y: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: E = None
        self.o: D = None
        self.w: C = None
        self.v: G = None
        self.q: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: B = None
        self.o: D = None
        self.txt = txt

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

e = A("e")
f = B("f")
j = C("j")
b = D("b")
l = E("l")
d = F("d")
m = G("m")
c = D("c")
k = G("k")
h = F("h")

e.u = b
e.o = c
e.y = d
f.u = d
j.p = f
j.q = e
b.r = j
b.w = j
b.p = l
b.q = l
b.o = c
b.v = k
l.p = e
l.x = e
d.v = h
d.u = f
d.o = c
m.w = k
c.r = j
c.w = j
c.p = l
c.q = l
c.o = b
c.v = m
k.w = m
h.v = d
h.u = f
h.o = c
assert j.p.u.o.v.w.txt == "k"