class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: B = None
        self.o: G = None
        self.r: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: D = None
        self.txt = txt

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

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

a.w = e
a.t = d
a.o = i
a.r = j
d.o = h
d.s = h
d.q = l
d.y = c
d.w = e
d.p = b
e.p = c
e.z = i
b.y = d
b.q = j
b.r = h
j.w = b
h.p = j
h.y = b
l.t = c
l.z = b
c.w = e
c.t = d
c.o = l
c.r = j
i.t = a
i.z = b
assert e.p.r.w.q.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: B = None
        self.o: G = None
        self.r: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: D = None
        self.txt = txt

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

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

a.w = e
a.t = d
a.o = i
a.r = j
d.o = h
d.s = h
d.q = l
d.y = c
d.w = e
d.p = b
e.p = c
e.z = i
b.y = d
b.q = j
b.r = h
j.w = b
h.p = j
h.y = b
l.t = c
l.z = b
c.w = e
c.t = d
c.o = l
c.r = j
i.t = a
i.z = b
assert e.p.r.w.q.txt == "j"