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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: C = None
        self.r: B = None
        self.w: D = None
        self.txt = txt

g = A("g")
f = B("f")
h = C("h")
j = D("j")
l = E("l")
n = F("n")
b = E("b")
k = F("k")
e = E("e")
m = E("m")

g.w = f
g.r = f
g.u = f
f.x = g
h.w = j
h.q = l
h.y = k
j.u = h
j.t = e
l.y = f
n.y = h
n.v = h
n.r = f
n.w = j
b.y = f
k.y = h
k.v = h
k.r = f
k.w = j
e.y = f
m.y = f
assert l.y.x.r.x.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.r: B = None
        self.u: B = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: C = None
        self.r: B = None
        self.w: D = None
        self.txt = txt

g = A("g")
f = B("f")
h = C("h")
j = D("j")
l = E("l")
n = F("n")
b = E("b")
k = F("k")
e = E("e")
m = E("m")

g.w = f
g.r = f
g.u = f
f.x = g
h.w = j
h.q = l
h.y = k
j.u = h
j.t = e
l.y = f
n.y = h
n.v = h
n.r = f
n.w = j
b.y = f
k.y = h
k.v = h
k.r = f
k.w = j
e.y = f
m.y = f
assert l.y.x.r.x.w.txt == "f"