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

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

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: A = None
        self.x: A = None
        self.v: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: C = None
        self.txt = txt

d = A("d")
h = B("h")
a = C("a")
g = D("g")
j = E("j")
c = B("c")
f = D("f")

d.t = c
d.w = a
d.y = a
d.q = g
h.q = g
h.w = c
h.y = c
h.s = a
a.y = d
a.u = g
g.q = d
g.u = d
g.x = d
g.v = j
j.x = h
j.r = a
c.q = g
c.w = h
c.y = h
c.s = a
f.q = d
f.u = d
f.x = d
f.v = j
assert d.t.q.v.x.y.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: C = None
        self.y: C = None
        self.q: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: A = None
        self.x: A = None
        self.v: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: C = None
        self.txt = txt

d = A("d")
h = B("h")
a = C("a")
g = D("g")
j = E("j")
c = B("c")
f = D("f")

d.t = c
d.w = a
d.y = a
d.q = g
h.q = g
h.w = c
h.y = c
h.s = a
a.y = d
a.u = g
g.q = d
g.u = d
g.x = d
g.v = j
j.x = h
j.r = a
c.q = g
c.w = h
c.y = h
c.s = a
f.q = d
f.u = d
f.x = d
f.v = j
assert d.t.q.v.x.y.s.y.txt == "d"