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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: F = None
        self.w: C = None
        self.x: A = None
        self.o: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: B = None
        self.p: C = None
        self.r: C = None
        self.y: B = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: B = None
        self.x: B = None
        self.w: E = None
        self.txt = txt

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

l.w = b
l.o = b
l.s = j
l.t = j
l.y = g
g.v = j
g.w = j
g.p = n
g.o = n
g.x = l
j.y = g
f.o = g
b.u = j
b.p = j
b.r = j
b.z = g
b.y = g
b.q = g
n.r = l
n.v = g
n.x = g
n.w = b
m.u = j
m.p = j
m.r = j
m.z = g
m.y = g
m.q = g
assert n.w.r.y.x.o.r.y.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: C = None
        self.t: C = None
        self.y: B = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: F = None
        self.w: C = None
        self.x: A = None
        self.o: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: B = None
        self.p: C = None
        self.r: C = None
        self.y: B = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: B = None
        self.x: B = None
        self.w: E = None
        self.txt = txt

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

l.w = b
l.o = b
l.s = j
l.t = j
l.y = g
g.v = j
g.w = j
g.p = n
g.o = n
g.x = l
j.y = g
f.o = g
b.u = j
b.p = j
b.r = j
b.z = g
b.y = g
b.q = g
n.r = l
n.v = g
n.x = g
n.w = b
m.u = j
m.p = j
m.r = j
m.z = g
m.y = g
m.q = g
assert n.w.r.y.x.o.r.y.txt == "g"