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

class B:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: B = None
        self.w: E = None
        self.u: D = None
        self.p: E = None
        self.txt = txt

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

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

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

l = A("l")
g = B("g")
i = C("i")
e = D("e")
d = E("d")
f = D("f")
m = A("m")
b = B("b")
j = D("j")
c = A("c")

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

class B:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: B = None
        self.w: E = None
        self.u: D = None
        self.p: E = None
        self.txt = txt

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

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

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

l = A("l")
g = B("g")
i = C("i")
e = D("e")
d = E("d")
f = D("f")
m = A("m")
b = B("b")
j = D("j")
c = A("c")

l.t = c
l.u = j
l.r = i
l.w = m
g.s = b
g.y = b
g.w = d
g.p = d
g.u = j
i.u = j
i.v = b
i.s = g
e.p = i
e.r = g
d.p = i
f.p = i
f.r = b
m.t = l
m.w = l
m.u = j
m.r = i
b.s = g
b.y = g
b.w = d
b.p = d
b.u = f
j.p = i
j.r = g
c.t = m
c.w = m
c.u = j
c.r = i
assert l.t.u.r.y.u.p.u.r.p.txt == "d"