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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: C = None
        self.o: F = None
        self.u: F = None
        self.z: E = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: C = None
        self.u: F = None
        self.txt = txt

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

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

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

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

g.w = i
d.s = j
d.o = j
d.t = a
d.x = a
d.u = l
d.z = b
a.w = b
a.r = m
a.u = l
i.s = j
i.t = a
b.r = e
j.t = d
j.x = i
m.w = b
m.r = a
m.u = j
e.t = d
e.x = i
l.t = d
l.x = i
assert l.x.t.w.r.x.t.r.r.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: C = None
        self.o: F = None
        self.u: F = None
        self.z: E = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: C = None
        self.u: F = None
        self.txt = txt

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

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

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

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

g.w = i
d.s = j
d.o = j
d.t = a
d.x = a
d.u = l
d.z = b
a.w = b
a.r = m
a.u = l
i.s = j
i.t = a
b.r = e
j.t = d
j.x = i
m.w = b
m.r = a
m.u = j
e.t = d
e.x = i
l.t = d
l.x = i
assert l.x.t.w.r.x.t.r.r.w.txt == "b"